<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .k{
            width:100px;
            height:100px;
            border:1px solid gold;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="k" v-pos:[position]='h'></div>
    </div>
    <script src="../vue.js"></script>
    <script>
        new Vue({
            el:'#app',
            data () {
                return {
                    h:200,
                    position:{
                        l:'left',
                        t:'top',
                    }
                }
            },
            directives:{
                pos:{
                    inserted(el,binding, vNode){
                        console.log(binding);
                        el.style.position='fixed';
                        let p=binding.arg;
                        el.style[p.l]=binding.value+'px';
                        el.style[p.t]=binding.value+'px';
                    }
                }
            }
        })
    </script>
</body>
</html>